function [output, Wm, Wn] = lab2dht(inImg)

M = size(inImg,1);
N = size(inImg,2);

Wm = zeros(M);
Wn = zeros(N);

haarCoeff = 1/2;
colNum = 1;

for i=1:2:M
    Wm(colNum,i)=haarCoeff;
    Wm(colNum,i+1)=haarCoeff;
    Wm(colNum+N/2,i)=-haarCoeff;
    Wm(colNum+N/2,i+1)=haarCoeff;
    colNum = colNum + 1;
end

colNum = 1;
for i=1:2:N
    Wn(colNum,i)=haarCoeff;
    Wn(colNum,i+1)=haarCoeff;
    Wn(colNum+N/2,i)=-haarCoeff;
    Wn(colNum+N/2,i+1)=haarCoeff;
    colNum = colNum + 1;
end

output = Wm*double(inImg)*Wn';
imshow(mat2gray(output));
end